﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace TestRunner.Events
{
    public static class EventManager
    {
        public static event EventHandler<FontFamilyEventArgs> evFontTypeChange;
        public static event EventHandler<FontSizeEventArgs> evFontSizeChange;
        public static event EventHandler<ColorEventArgs> evFontColorShapeChange;
        public static event EventHandler<BoolEventArgs> evFontItalic;
        public static event EventHandler<BoolEventArgs> evFontBold;
        public static event EventHandler<BoolEventArgs> evFontUnderline;
        public static event EventHandler<TestAligmentArgs> evTextAlignmentChange;
        public static event EventHandler<ColorEventArgs> evFillShapeChange;
        public static event EventHandler<ColorEventArgs> evBorderColorShapeChange;
        public static event EventHandler<DoubleEventArgs> evBorderLineWidth;
        public static event EventHandler<DoubleCollectionEventArgs> evBorderLineStyle;


        public static void FireFontColorShapeChanged(object sender, Color color)
        {
            if (evFontColorShapeChange != null)
            {
                evFontColorShapeChange(sender, new ColorEventArgs() { SelectedColor = color });
            }
        }

        public static void FireFillColorShapeChanged(object sender, Color color)
        {
            if (evFillShapeChange != null)
            {
                evFillShapeChange(sender, new ColorEventArgs() { SelectedColor = color });
            }
        }

        
        public static void FireBorderColorShapeChanged(object sender, Color color)
        {
            if (evBorderColorShapeChange != null)
            {
                evBorderColorShapeChange(sender, new ColorEventArgs() { SelectedColor = color });
            }
        }


        public static void FireFontFamilyShapeChanged(object sender, FontFamily fontFamily)
        {
            if (evFontTypeChange != null)
            {
                evFontTypeChange(sender, new FontFamilyEventArgs() { SelectedFontFamily = fontFamily });
            }
        }

        public static void FireFontSizeShapeChanged(object sender, double fontSize)
        {
            if (evFontSizeChange != null)
            {
                evFontSizeChange(sender, new FontSizeEventArgs() { SelectedFontSize = fontSize });
            }
        }

        public static void FireSelectedTextAlignment(object sender, HorizontalAlignment alignment)
        {
            if (evTextAlignmentChange != null)
            {
                evTextAlignmentChange(sender, new TestAligmentArgs() { SelectedAlignment = alignment });
            }
        }


        public static void FireSelectedFontItalic(object sender, bool IsItalic)
        {
            if (evFontItalic != null)
            {
                evFontItalic(sender, new BoolEventArgs() { SelectedValue = IsItalic });
            }
        }

        public static void FireSelectedFontBold(object sender, bool IsBold)
        {
            if (evFontBold != null)
            {
                evFontBold(sender, new BoolEventArgs() { SelectedValue = IsBold });
            }
        }

        public static void FireSelectedFontUnderline(object sender, bool IsUnderLine)
        {
            if (evFontUnderline != null)
            {
                evFontUnderline(sender, new BoolEventArgs() { SelectedValue = IsUnderLine });
            }
        }

        
        public static void FireSelectedBorderLineWidth(object sender, double width)
        {
            if (evBorderLineWidth != null)
            {
                evBorderLineWidth(sender, new DoubleEventArgs() { SelectedValue = width });
            }
        }

        
        public static void FireSelectedBorderLineStyle(object sender, DoubleCollection style)
        {
            if (evBorderLineStyle != null)
            {
                evBorderLineStyle(sender, new DoubleCollectionEventArgs() { SelectedValue = style });
            }
        }
    }
}
